<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputLabel value="#{messages.Logs}"></h:outputLabel>
        </ui:define>
        <ui:define name="body">
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{messages.Select}#{messages.Role}"/>
                    <h:selectOneMenu value="#{logsController.roleType}" immediate="true">
                        <f:selectItem itemLabel="#{messages.Please}#{messages.Select}"/>
                        <f:selectItems value="#{roleinfoControllerA.allList}" var="role" itemLabel="#{messages.getString(role.rolename)}"/>
                        <f:ajax render="@form"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:panelGrid id="stuItems" columns="2" rendered="#{logsController.studentShow}">
                    <h:outputLabel value="#{messages.Select}#{messages.Student}"/>
                    <h:selectOneMenu value="#{logsController.student}" immediate="true">
                        <f:selectItem itemLabel="#{messages.Please}#{messages.Select}"/>
                        <f:selectItems value="#{logsControllerA.logsStudents}" var="students" itemLabel="#{students.secondname} #{students.firstname}"/>
                        <f:ajax render="logs"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:panelGrid id="teaItems" columns="2" rendered="#{logsController.teacherShow}">
                    <h:outputLabel value="#{messages.Select}#{messages.Teacher}"/>
                    <h:selectOneMenu value="#{logsController.teacherAdmin}" immediate="true">
                        <f:selectItem itemLabel="#{messages.Please}#{messages.Select}"/>
                        <f:selectItems value="#{logsControllerA.logsTeachers}" var="students" itemLabel="#{students.secondname} #{students.firstname}"/>
                        <f:ajax render="logs"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:outputLabel value="#{logsController.pagination.pageFirstItem + 1}..#{logsController.pagination.pageLastItem + 1}/#{logsController.pagination.itemsCount}"/>&nbsp;
                <h:commandLink action="#{logsController.pageOperation.previous}" value="#{messages.Previous} #{logsController.pagination.pageSize}" rendered="#{logsController.pagination.hasPreviousPage}"/>&nbsp;
                <h:commandLink action="#{logsController.pageOperation.next}" value="#{messages.Next} #{logsController.pagination.pageSize}" rendered="#{logsController.pagination.hasNextPage}"/>&nbsp;

                <h:dataTable value="#{logsController.items}" id="logs" var="item" border="0" cellpadding="2" cellspacing="0" 
                             rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" 
                             columnClasses="editRemoveview">
                    <h:column >
                        <f:facet name="header">
                            <h:outputLabel value="#{messages.Detail}"/>
                        </f:facet>   
                        <h:outputLabel value="#{publicFields.getDateExpression(item.operationtime)} #{item.toString()}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
